# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-dumb-init
_pyname=dumb-init
pkgver=1.2.5
pkgrel=2
arch="all"
pkgdesc="Simple wrapper script which proxies signals to a child"
url="https://pypi.python.org/project/dumb-init"
license="MIT"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	bash
	py3-pytest
"
source="$pkgname-$pkgver.tar.gz::https://github.com/Yelp/dumb-init/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	PATH="$PATH:$builddir/.testenv/bin" \
		.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	# installs leftover testing files
	rm -R "$pkgdir"/usr/lib/python*/site-packages/testing
}

sha512sums="
b2822f8d80050edd03495acb74c3087a9d4bbadd0250ea0166d67799d4308a2e29e1f08c404c232a418c6f09cfdd8ccb4fed1b29395e1b670965b770b9f310cf  py3-dumb-init-1.2.5.tar.gz
"
